file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
# 设置静态库输出位置
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/build/lib)
# 生成静态库
add_library(json STATIC ${SOURCES})
# 生成动态库
add_library(jsonDll SHARED ${SOURCES})
# 设置动态库输出位置
set_target_properties(jsonDll PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/build/share)

# 依赖的头文件
target_include_directories(json PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(json PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../inc)
target_include_directories(jsonDll PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
target_include_directories(jsonDll PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../../inc)

